/*******************************************************************************
** www.IfcGears.com                                                           **
** Copyright (C) 2010 - Bauhaus University Weimar, www.uni-weimar.de          **
** Written: 2010-10-02, Fabian Gerold, www.fabiangerold.de                    **
*******************************************************************************/

#pragma once

#include <set>
#include <QtGui>

class Attribute;
class IfcGears;
class IfcRelease;

class Type
{
public:
	Type( IfcGears* gears );
	int getNumAttributesIncludingSupertypes();
	QString getCodeHeader();
	QString getCodeWriterType();

	bool setSchema( QString schema );
	void setSchemaVersion( QString schema_version, shared_ptr<IfcRelease> ifc_release );
	QString getSchemaVersion() { return m_schema_version; }

	bool parse();
	QString getTypeReader( QString obj_name );
	QString getClassDeclaration();
	QString getCodeCpp();
	void getAllSuperClasses( QStringList& all_super_classes, bool gears_type = true );
	void getAllSelectClasses( QStringList& all_select_classes );
	void linkDependencies();

	IfcGears*				m_gears;
	shared_ptr<IfcRelease>	m_ifc_release;
	QString					m_classname;
	QString 				m_schema;
	
	QString 				m_header;
	QString					m_base_datatype;
	QString					m_attribute_declaration;
	QString 				m_super_primitive;
	int						m_super_primitive_min;
	int						m_super_primitive_max;
	shared_ptr<Type> 		m_supertype;
	QStringList 			m_super_enums;
	QStringList 			m_select;
	QStringList				m_select_supertypes;

	bool					m_reader_needs_object_map;
	bool					m_typedef;

private:
	QString					m_schema_version;
};
